﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using CanDoo.Core.Data;
using CanDoo.Data;
using CanDoo.Admin.Core.Models;

namespace CanDoo.Oil.Core.Models
{
    /// <summary>
    /// 实体类——供应商
    /// </summary>
    [Serializable]
    [Description("供应商")]
    public class Supplier :  EntityBase,ICreatedTime, IAudited,IRecyclable
    {
        /// <summary>
        ///供应商编号
        /// </summary>
        [Display(Name = "供应商编号")]
        [Required, StringLength(50)]
        public string Code { get; set; }

        /// <summary>
        ///供应商简称
        /// </summary>
        [Display(Name = "供应商简称")]
        [Required, StringLength(50)]
        public string ShortName { get; set; }

        /// <summary>
        ///供应商全称
        /// </summary>
        [Display(Name = "供应商全称")]
        [Required, StringLength(100)]
        public override string Name { get; set; }

        /// <summary>
        ///供应商类别
        /// </summary>
        [Display(Name = "供应商类别")]
        public virtual SupplierType SupplierType { get; set; }
        /// <summary>
        ///供应商类别外键
        /// </summary>
        [Display(Name = "供应商类别外键")]
        public long SupplierTypeId { get; set; }

        /// <summary>
        ///电话
        /// </summary>
        [Display(Name = "电话")]
        [StringLength(50)]
        public string Tel { get; set; }

        /// <summary>
        ///手机
        /// </summary>
        [Display(Name = "手机")]
        [StringLength(50)]
        public string Mobile { get; set; }

        /// <summary>
        ///QQ
        /// </summary>
        [Display(Name = "QQ")]
        [StringLength(50)]
        public string QQ { get; set; }

        /// <summary>
        ///微信
        /// </summary>
        [Display(Name = "微信")]
        [StringLength(50)]
        public string WebChat { get; set; }

        /// <summary>
        ///网站
        /// </summary>
        [Display(Name = "网站")]
        [StringLength(200)]
        public string WebSite { get; set; }

        /// <summary>
        ///传真
        /// </summary>
        [Display(Name = "传真")]
        [StringLength(50)]
        public string Fax { get; set; }

        /// <summary>
        ///法人代表
        /// </summary>
        [Display(Name = "法人代表")]
        [StringLength(50)]
        public string LegalPerson { get; set; }

        /// <summary>
        ///默认收货仓库
        /// </summary>
        [Display(Name = "默认收货仓库")]
        public virtual Warehouse Warehouse { get; set; }
        /// <summary>
        ///默认收货仓库外键
        /// </summary>
        [Display(Name = "默认收货仓库外键")]
        public long? WarehouseId { get; set; }

        /// <summary>
        ///注册资金
        /// </summary>
        [Display(Name = "注册资金")]
        public double RegMoney { get; set; }

        /// <summary>
        ///详细地址
        /// </summary>
        [Display(Name = "详细地址")]
        [StringLength(50)]
        public string Address { get; set; }

        /// <summary>
        ///执照号
        /// </summary>
        [Display(Name = "执照号")]
        [StringLength(50)]
        public string License { get; set; }

        /// <summary>
        ///启用
        /// </summary>
        [Display(Name = "启用")]
        [Required]
        public bool Enable { get; set; }

        /// <summary>
        ///账期
        /// </summary>
        [Display(Name = "账期")]
        [Required]
        public int AccountPeriod { get; set; }

        /// <summary>
        ///备注
        /// </summary>
        [Display(Name = "备注")]
        [StringLength(500)]
        public string Remark { get; set; }

        
        #region Implementation of ICreatedTime

        /// <summary>
        /// 获取设置 信息创建时间
        /// </summary>
        [Display(Name = "创建时间")]
        public DateTime CreatedTime { get; set; }
        #endregion

        #region Implementation of ICreatedAudited

        /// <summary>
        /// 获取或设置 创建者编号
        /// </summary>
        [Display(Name = "创建人")]
        public string CreatorUserId { get; set; }

        #endregion

        #region Implementation of IUpdateAutited

        /// <summary>
        /// 获取或设置 最后更新时间
        /// </summary>
        [Display(Name = "最后更新时间")]
        public DateTime? LastUpdatedTime { get; set; }

        /// <summary>
        /// 获取或设置 最后更新者编号
        /// </summary>
        [Display(Name = "最后更新用户")]
        public string LastUpdatorUserId { get; set; }

        #endregion

        #region Implementation of IsDeleted 逻辑删除接口
        /// <summary>
        /// 逻辑删除接口
        /// </summary>
        [Display(Name = "是否删除")]
        public bool IsDeleted { get; set; }
        #endregion
    }
}
